package com.yy.chapter7.service.impl;

import com.yy.chapter7.jparepository.UserJpa;
import com.yy.chapter7.service.UserService;
import com.yy.chapter7.vo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author yangyao
 * @Description: UserServiceImpl
 * @date 2018/10/24 09:18
 */
@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserJpa userJpa;

    @Override
    public User findByUserName(String userName) throws Exception {
        return this.userJpa.findByUserName(userName);
    }

    @Override
    public List<User> findAll() throws Exception{
        return this.userJpa.findAll();
    }
}
